package com.example.demo.rx.cat;

import io.reactivex.rxjava3.core.Observable;

import java.net.URL;
import java.util.List;

public interface Api {
    interface CatsQueryCallback {
        void onCatListReceived(List<Cat> cats);
        void onQueryFailed(Exception e);
    }
    interface StoreCallback {
        void onCatStored(URL url);
        void onStoreFailed(Exception e);
    }
    void queryCats(String query, CatsQueryCallback callback);
    void store(Cat cat, StoreCallback callback);

    Observable<List<Cat>> queryCats(String query);
    Observable<URL> store(URL url);
}
